package com.springmvc.test;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;

import java.util.Date;


@Component
public class QuartzTimer{
    int a = 1;
    public void execute() {
        ApplicationContext ac = new ClassPathXmlApplicationContext("spring-aop.xml");
        King br = (King) ac.getBean("king");
        br.saying();
        System.out.println("我的quartz任务调度" +  new Date() + "     " + a++);
    }
}